import request from '@/request/index.js'
import { C2B  } from '../utils/wordtransfer'

/**
 * 查询房间列表
 */
export const list = (data={keyword:''})=>{
    return request.post(`/room/list`,data)
}

/**
 * 查询房间列表并分页
 */
export const page = (data={keyword:''})=>{
    return request.post(`/room/page`,data)
}

/**
 * 根据id查询房间信息
 */
export const GetById = ( id )=>{
    return request.post(`/room/get/${id}`)
}

/**
 * 保存房间
 */
export const SaveData = ( data )=>{
    return request.post(`/room/save`,data)
}

/**
 * 更新房间信息
 */
export const UpdateData = ( data )=>{
    return request.post(`/room/update`,data)
}


/**
 * 根据id删除房间信息
 */
export const DelById = ( id )=>{
    return request.post(`/room/delete/${id}`)
}

/**
 * 批量导出二维码
 */
export const pullCode = (  )=>{
    return request.get(`/room/code`,{ responseType: 'blob' })
}

/**
 * 查询房间已绑定的冷池
 */
export const roomPools = ( id )=>{
    return request.post(`/room/pool/list/${id}`)
}

/**
 * 查询房间已绑定的冷池
 */
export const bindPool = ( data )=>{
    return request.post(`/room/bind/pool`,data)
}

/**
 * 查询房间已绑定的基础项
 */
export const roomBasis = ( id )=>{
    return request.post(`/room/basis/list/${id}`)
}

/**
 * 查询房间已绑定的基础项
 */
export const bindBasis = ( data )=>{
    return request.post(`/room/bind/basis`,data)
}

/**
 * 查询房间已绑定的重要端口
 */
export const roomPorts = ( id )=>{
    return request.post(`/room/port/list/${id}`)
}

/**
 * 查询房间已绑定的重要端口
 */
export const bindPort = ( data )=>{
    return request.post(`/room/bind/port`,data)
}

/**
 * 查询房间已绑定的重要设备
 */
export const roomDevices = ( id )=>{
    return request.post(`/room/device/list/${id}`)
}

/**
 * 查询房间已绑定的重要设备
 */
export const bindDevice = ( data )=>{
    return request.post(`/room/bind/device`,data)
}

